home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Draw / CScreen_Debrief.as < prev    next >
Text File  |  2011-08-19  |  12KB  |  343 lines

  1. package Local.Draw
  2. {
  3.    import Local.CGlobal;
  4.    import Local.External.CURL;
  5.    import Local.Game.Level.CLevelData;
  6.    import Local.Math.CSecureNumber;
  7.    import flash.display.MovieClip;
  8.    import flash.events.Event;
  9.    import flash.geom.Rectangle;
  10.    import flash.text.TextField;
  11.    
  12.    public class CScreen_Debrief extends CScreen
  13.    {
  14.       
  15.       public static var mScore:CSecureNumber;
  16.       
  17.       public static var mGameState:String;
  18.       
  19.       private static const mStandardName:String = "[ENTER NAME]";
  20.        
  21.       
  22.       public var mcButtonRetry:MovieClip;
  23.       
  24.       private var mPostWindow:CWindow_PostScore;
  25.       
  26.       public var mcBackground:MovieClip;
  27.       
  28.       public var mcLogo:MovieClip;
  29.       
  30.       public var mcButtonBack:MovieClip;
  31.       
  32.       public var mcButtonPostScore:MovieClip;
  33.       
  34.       public var tbUsername:TextField;
  35.       
  36.       public var mcMoreGames:MovieClip;
  37.       
  38.       public var mcButtonViewScores:MovieClip;
  39.       
  40.       public var mcSize:MovieClip;
  41.       
  42.       public var mcScore:MovieClip;
  43.       
  44.       public var mcGameState:MovieClip;
  45.       
  46.       public var mcLock:MovieClip;
  47.       
  48.       public function CScreen_Debrief()
  49.       {
  50.          if(true)
  51.          {
  52.             super();
  53.             if(true)
  54.             {
  55.                AddButton("postscore",new CScreenButton(mcButtonPostScore,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_POSTSCORE);
  56.                if(true)
  57.                {
  58.                   AddButton("viewscores",new CScreenButton(mcButtonViewScores,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_VIEWSCORES);
  59.                   if(true)
  60.                   {
  61.                      AddButton("retry",new CScreenButton(mcButtonRetry,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_RETRY);
  62.                      AddLogoButton();
  63.                   }
  64.                   AddBackButton("main");
  65.                }
  66.                AddMoreGamesButton("Debrief");
  67.             }
  68.             tbUsername.text = CGlobal.GetField("playerid") == null ? mStandardName : CGlobal.GetField("playerid");
  69.          }
  70.       }
  71.       
  72.       private function e_WINDOW_DISPOSING(param1:Event = null) : void
  73.       {
  74.          if(true)
  75.          {
  76.             mPostWindow = null;
  77.          }
  78.       }
  79.       
  80.       override public function Activate() : void
  81.       {
  82.          var _loc1_:Rectangle = null;
  83.          if(true)
  84.          {
  85.             super.Activate();
  86.             if(true)
  87.             {
  88.                FillScore(mcScore,mScore.mValue);
  89.             }
  90.             mcScore.x = 0;
  91.          }
  92.          _loc1_ = mcScore.getBounds(mcScore.parent);
  93.          if(true)
  94.          {
  95.             mcScore.x = (mSize.width - _loc1_.width) / 2 - _loc1_.x;
  96.          }
  97.          switch(mGameState)
  98.          {
  99.             case "complete":
  100.                mcGameState.gotoAndStop(1);
  101.                if(true)
  102.                {
  103.                   mcLock.visible = !(mScore.mValue >= 1 && !CGlobal.GetField("CHEATS"));
  104.                   addr96:
  105.                   break;
  106.                }
  107.                break;
  108.             case "died":
  109.                mcGameState.gotoAndStop(2);
  110.                if(true)
  111.                {
  112.                }
  113.                ┬º┬ºgoto(addr96);
  114.             case "exit":
  115.                mcGameState.gotoAndStop(3);
  116.                ┬º┬ºgoto(addr96);
  117.             default:
  118.                ┬º┬ºgoto(addr96);
  119.          }
  120.       }
  121.       
  122.       private function e_RETRY(param1:Event = null) : void
  123.       {
  124.          var _loc2_:CScreenButton = null;
  125.          _loc2_ = CScreenButton(param1.currentTarget);
  126.          mParent.GetScreen("selectlevel").Activate();
  127.       }
  128.       
  129.       private function e_VIEWSCORES(param1:Event = null) : void
  130.       {
  131.          var _loc2_:CScreenButton = null;
  132.          _loc2_ = CScreenButton(param1.currentTarget);
  133.          if(true)
  134.          {
  135.             CURL.ViewHiscore(CLevelData.mGameID);
  136.          }
  137.       }
  138.       
  139.       override public function Process() : void
  140.       {
  141.          super.Process();
  142.          ┬º┬ºpush(mPostWindow);
  143.          if(true)
  144.          {
  145.             if(┬º┬ºpop())
  146.             {
  147.                addr16:
  148.                mPostWindow.Update();
  149.             }
  150.             return;
  151.          }
  152.          ┬º┬ºgoto(addr16);
  153.       }
  154.       
  155.       private function e_POSTSCORE(param1:Event = null) : void
  156.       {
  157.          var _loc2_:CScreenButton = null;
  158.          _loc2_ = CScreenButton(param1.currentTarget);
  159.          CGlobal.SetField("playerid",tbUsername.text);
  160.          addChild(mPostWindow = new CWindow_PostScore(stage));
  161.          ┬º┬ºpush(mPostWindow);
  162.          ┬º┬ºpush(CWindow_PostScore.CANCELLED);
  163.          if(true)
  164.          {
  165.             ┬º┬ºpop().addEventListener(┬º┬ºpop(),e_WINDOW_PSCORE_CANCEL);
  166.             ┬º┬ºpush(mPostWindow);
  167.             ┬º┬ºpush(CWindow.DISPOSING);
  168.          }
  169.          ┬º┬ºpop().addEventListener(┬º┬ºpop(),e_WINDOW_DISPOSING);
  170.          mcLock.visible = true;
  171.       }
  172.       
  173.       private function FillScore(param1:MovieClip, param2:Number) : void
  174.       {
  175.          var _loc3_:int = 0;
  176.          var _loc4_:Number = NaN;
  177.          var _loc5_:int = 0;
  178.          var _loc6_:* = undefined;
  179.          var _loc7_:MovieClip = null;
  180.          var _loc8_:* = 0;
  181.          if(!param1.mBackupChildren)
  182.          {
  183.             param1.mBackupChildren = new Array();
  184.             _loc5_ = 0;
  185.             loop2:
  186.             while(true)
  187.             {
  188.                if(_loc5_ < param1.numChildren)
  189.                {
  190.                   continue;
  191.                }
  192.                if(true)
  193.                {
  194.                   addr88:
  195.                   _loc3_ = 0;
  196.                   addr90:
  197.                   _loc4_ = 1;
  198.                }
  199.                loop5:
  200.                while(true)
  201.                {
  202.                   ┬º┬ºpush(_loc3_ < 12);
  203.                   if(_loc3_ < 12)
  204.                   {
  205.                      addr205:
  206.                      ┬º┬ºpop();
  207.                      while(true)
  208.                      {
  209.                         ┬º┬ºpush(Boolean(param1["d" + _loc3_]));
  210.                         ┬º┬ºgoto(addr205);
  211.                      }
  212.                      addr206:
  213.                   }
  214.                   while(true)
  215.                   {
  216.                      if(!┬º┬ºpop())
  217.                      {
  218.                         break loop2;
  219.                      }
  220.                      _loc7_ = param1["d" + _loc3_];
  221.                      ┬º┬ºpush(int(Math.floor(param2 / _loc4_)));
  222.                      ┬º┬ºpush(int(Math.floor(param2 / _loc4_)));
  223.                      if(true)
  224.                      {
  225.                         _loc8_ = ┬º┬ºpop();
  226.                         ┬º┬ºpush(0);
  227.                         if(true)
  228.                         {
  229.                            ┬º┬ºpush(┬º┬ºpop() == ┬º┬ºpop());
  230.                            if(true)
  231.                            {
  232.                               if(┬º┬ºpop())
  233.                               {
  234.                                  if(true)
  235.                                  {
  236.                                     ┬º┬ºpop();
  237.                                     ┬º┬ºpush(_loc3_);
  238.                                     ┬º┬ºpush(0);
  239.                                     if(true)
  240.                                     {
  241.                                        ┬º┬ºpush(┬º┬ºpop() == ┬º┬ºpop());
  242.                                        if(true)
  243.                                        {
  244.                                           ┬º┬ºpush(!┬º┬ºpop());
  245.                                           if(true)
  246.                                           {
  247.                                              addr140:
  248.                                              if(┬º┬ºpop())
  249.                                              {
  250.                                                 param1.removeChild(_loc7_);
  251.                                              }
  252.                                              else
  253.                                              {
  254.                                                 _loc7_.gotoAndStop(_loc8_ % 10 + 1);
  255.                                              }
  256.                                              ┬º┬ºpush(_loc3_ == 0);
  257.                                              if(true)
  258.                                              {
  259.                                                 ┬º┬ºpush(!┬º┬ºpop());
  260.                                                 if(true)
  261.                                                 {
  262.                                                    ┬º┬ºpush(┬º┬ºpop() && _loc3_ % 3 == 0);
  263.                                                 }
  264.                                                 if(┬º┬ºpop())
  265.                                                 {
  266.                                                 }
  267.                                                 addr181:
  268.                                                 if(┬º┬ºpop())
  269.                                                 {
  270.                                                    param1.removeChild(param1["c" + Math.floor(_loc3_ / 3 - 1)]);
  271.                                                 }
  272.                                                 _loc3_++;
  273.                                                 _loc4_ *= 10;
  274.                                                 continue loop5;
  275.                                              }
  276.                                              ┬º┬ºpop();
  277.                                              ┬º┬ºpush(_loc8_ == 0);
  278.                                           }
  279.                                           if(┬º┬ºpop())
  280.                                           {
  281.                                           }
  282.                                           ┬º┬ºgoto(addr181);
  283.                                        }
  284.                                        ┬º┬ºpop();
  285.                                        addr180:
  286.                                        ┬º┬ºgoto(addr181);
  287.                                        ┬º┬ºpush(_loc3_ != 0);
  288.                                     }
  289.                                     ┬º┬ºgoto(addr165);
  290.                                  }
  291.                                  ┬º┬ºgoto(addr180);
  292.                               }
  293.                               ┬º┬ºgoto(addr140);
  294.                            }
  295.                            ┬º┬ºgoto(addr181);
  296.                         }
  297.                         ┬º┬ºgoto(addr140);
  298.                      }
  299.                      ┬º┬ºgoto(addr180);
  300.                      continue loop5;
  301.                   }
  302.                   ┬º┬ºgoto(addr205);
  303.                }
  304.             }
  305.             return;
  306.          }
  307.          do
  308.          {
  309.             if(param1.numChildren)
  310.             {
  311.                continue;
  312.             }
  313.             if(true)
  314.             {
  315.                var _loc9_:int = 0;
  316.                if(true)
  317.                {
  318.                   for each(_loc6_ in param1.mBackupChildren)
  319.                   {
  320.                      if(true)
  321.                      {
  322.                         param1.addChild(_loc6_);
  323.                      }
  324.                   }
  325.                }
  326.             }
  327.          }
  328.          while(param1.removeChildAt(0), true);
  329.          
  330.          ┬º┬ºgoto(addr90);
  331.          ┬º┬ºgoto(addr88);
  332.       }
  333.       
  334.       private function e_WINDOW_PSCORE_CANCEL(param1:Event = null) : void
  335.       {
  336.          if(true)
  337.          {
  338.             mcLock.visible = false;
  339.          }
  340.       }
  341.    }
  342. }
  343.